#include <iostream>

#include "../include/CarController.h"

int main() {
    TemplateCenter::initTemplateCenter();
    IdManager::initIdManager();
    IdManager* idManager = IdManager::getIdManager();
    idManager->registered("SmartCar","cqusn",16);
    CarController* testCarController = new CarController();
    SmartCar* testCar = testCarController->createCar();
    Component* laserC = testCar->addComponent(LASERRADAR);
    Component* chassis = testCar->addComponent(CHASSIS);
    LaserRadar* laser = (LaserRadar*)laserC;
    laser->doAsCommend(testCar->getId()+":"+LASER_ADD_SUBSCRIBER+":"+CHASSIS);
    testCar->updateInfo();
    delete testCarController;
    TemplateCenter::deleteTemplateCenter();
    IdManager::deteleIdManager();
    return 0;
}